package com.ruoyi.system.domain.params;

import lombok.Data;

/**
 * @author: 陈平安
 * @date: 2023/3/12 15:35
 * @description: 仓库订单打印模板
 */
@Data
public class WarehousePrintParams {

    // 换行
    private static final String BR = "<BR>";
    private static final String DBR = "<BR><BR>";
    // 切刀指令
    private static final String CUT = "<CUT>";
    // 放大一倍
    private static final String L1 = "<L1>%s</L1>";
    // 放大两倍
    private static final String L2 = "<L2>%s</L2>";
    // 居中
    private static final String C = "<C>%s</C>";
    // 字体变高一倍
    private static final String H = "<H>%s</H>";
    // 字体变宽一倍
    private static final String W = "<W>%s</W>";
    // 右对齐
    private static final String R = "<R>%s</R>";
    // 字体加粗
    private static final String B = "<B>%s</B>";
    // 二维码
    private static final String QRCODE = "<QRCODE>%s</QRCODE>";

    /** 标题 */
    private String titleCn;

    /** 订单号 */
    private String orderTitle;
    private String orderNo;

    /** 入仓日期 */
    private String warehousingTimeTitle;
    private String warehousingTime;

    /** 客户名字 */
    private String customerNameTitle;
    private String customerName;

    /** 包裹名称 */
    private String packageNameTitle;
    private String packageName;

    /** 包裹内容 */
    private String packageContentTitle;
    private String packageContent;

    /** 包裹数量 */
    private String packageNumTitle;
    private String packageNum;

    /** 总件数量 */
    private String totalTitle;
    private String total;

    /** 总件数量 */
    private String areaTitle;
    private String area;

    /** 打包类型 */
    private String baleTypeTitle;
    private String baleType;

    /** 打包数量 */
    private String baleNumTitle;
    private String baleNum;

    /** 打包备注 */
    private String baleRemarkTitle;
    private String baleRemark;

    /**
     * 底部广告
     */
    private String bottom;

    public String getTitleCn() {
        this.titleCn = String.format(B,String.format(C,"仓库包裹单")) + DBR;
        return titleCn;
    }

    public String getOrderTitle() {
        this.orderTitle = "订单编号：" + BR;
        return orderTitle;
    }

    public String getOrderNo() {
        return orderNo + DBR;
    }

    public String getWarehousingTimeTitle() {
        this.warehousingTimeTitle = "进仓时间：" + BR;
        return warehousingTimeTitle;
    }

    public String getWarehousingTime() {
        return warehousingTime + DBR;
    }

    public String getCustomerNameTitle() {
        this.customerNameTitle = "客户名称：" + BR;
        return customerNameTitle;
    }

    public String getCustomerName() {
        return customerName + DBR;
    }

    public String getPackageNameTitle() {
        this.packageNameTitle = "包裹名称：" + BR;
        return packageNameTitle;
    }

    public String getPackageName() {
        return packageName + DBR;
    }

    public String getPackageContentTitle() {
        this.packageContentTitle = "包裹内容：" +BR;
        return packageContentTitle;
    }

    public String getPackageContent() {
        return packageContent + DBR;
    }

    public String getPackageNumTitle() {
        this.packageNumTitle = "包裹数量：" + BR;
        return packageNumTitle;
    }

    public String getPackageNum() {
        return packageNum + DBR;
    }

    public String getTotalTitle() {
        this.totalTitle = "总件数量：" + BR;
        return totalTitle;
    }

    public String getTotal() {
        return total + DBR;
    }

    public String getAreaTitle() {
        this.areaTitle = "存放区号：" + BR;
        return areaTitle;
    }

    public String getArea() {
        return area + DBR;
    }

    public String getBaleTypeTitle() {
        this.baleTypeTitle = "打包类型：" + BR;
        return baleTypeTitle;
    }

    public String getBaleType() {
        return baleType + DBR;
    }

    public String getBaleNumTitle() {
        this.baleNumTitle = "打包数量：" + BR;
        return baleNumTitle;
    }

    public String getBaleNum() {
        return baleNum + DBR;
    }

    public String getBaleRemarkTitle() {
        this.baleRemarkTitle = "打包备注：" + BR;
        return baleRemarkTitle;
    }

    public String getBaleRemark() {
        return baleRemark + DBR;
    }

    public String getBottom() {
        this.bottom = String.format(C, bottom);
        return bottom;
    }

    public String printContent(WarehousePrintParams params) {
        StringBuilder content = new StringBuilder("");
        content.append(params.getTitleCn());
        content.append(params.getOrderTitle());
        content.append(params.getOrderNo());
        content.append(params.getWarehousingTimeTitle());
        content.append(params.getWarehousingTime());
        content.append(params.getCustomerNameTitle());
        content.append(params.getCustomerName());
        content.append(params.getPackageNameTitle());
        content.append(params.getPackageName());
        content.append(params.getPackageContentTitle());
        content.append(params.getPackageContent());
        content.append(params.getPackageNumTitle());
        content.append(params.getPackageNum());
        content.append(params.getTotalTitle());
        content.append(params.getTotal());
        content.append(params.getAreaTitle());
        content.append(params.getArea());
        content.append(params.getBaleTypeTitle());
        content.append(params.getBaleType());
        content.append(params.getBaleNumTitle());
        content.append(params.getBaleNum());
        content.append(params.getBaleRemarkTitle());
        content.append(params.getBaleRemark());
        content.append(params.getBottom());
        return content.toString();
    }
}
